<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('AuditionOrder/index')}">订单列表</a></li>
    </ul>
    <form class="well form-inline margin-top-20" id="formurl" method="post" >
        关键字:
        <input type="text" class="form-control" name="keyword" style="width: 280px;" value="{:input('request.keyword/s','')}" placeholder="课程名称/分类名称/机构名称/订单号"><br>
        <!--机构:-->

        类型:
        <select class="form-control" name="order_type" style="margin-left: 15px;">
            <option value="">请选择类型</option>
            <option value="1" <if condition="$order_type eq 1">selected</if>>拼团订单</option>
            <option value="2" <if condition="$order_type eq 2">selected</if>>直接购买</option>
        </select>
        状态:
        <select class="form-control" name="order_status">
            <option value="">请选择状态</option>
            <option value="1" <if condition="$order_status eq 1">selected</if>>未付款</option>
            <option value="2" <if condition="$order_status eq 2">selected</if>>未成团</option>
            <option value="3" <if condition="$order_status eq 3">selected</if>>已成团/已付款</option>
        </select>
        时间:
        <input class="form-control js-bootstrap-datetime" type="text" name="start_time" style="width:150px;"
               value="{:input('request.start_time/s','')}" placeholder="请输入开始时间">
        -
        <input class="form-control js-bootstrap-datetime" type="text" name="end_time" style="width:150px;"
               value="{:input('request.end_time/s','')}" placeholder="请输入结束时间">
        <input type="submit" class="btn btn-primary" value="搜索" onclick="return search()" />
        <a class="btn btn-danger" href="{:url('AuditionOrder/index')}">清空</a>
        <input type="submit" class="form-control btn btn-xs btn-success" onclick="return excel()" value="导出Excel" />
    </form>
        <php>
            $status=array("1"=>'未付款',"2"=>'拼团中','3'=>array('1'=>'已成团','2'=>'已付款'));
            $order_type=array('1'=>'拼团','2'=>'直接购买');
        </php>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <!--<th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x"-->
                                             <!--data-checklist="js-check-x"></label></th>-->
                <th>ID</th>
                <th width="50">订单号</th>
                <th>课程名称</th>
                <th>分类名称</th>
                <th>机构名称</th>
                <th>订单金额</th>
                <th>分销金额</th>
                <th>成团人数</th>
                <th>创建时间</th>
                <th>订单类型</th>
                <th width="50">{:lang('STATUS')}</th>
                <th width="120">{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="vo">
                <tr>
                    <!--<td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"-->
                               <!--value="{$vo.AuditionOrder_id}"></td>-->
                    <td>{$vo.order_id}</td>
                    <td>{$vo.order_sn}</td>
                    <td>{$vo.course_name}</td>
                    <td>{$vo.cate_name}</td>
                    <td>{$vo.admin_name}</td>
                    <td>{$vo.order_price}</td>
                    <td>{$vo.proportion_price}</td>
                    <td>{$vo.now_num|default='无'}</td>
                    <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
                    <td>
                        <if condition="$vo.order_type eq 1">
                            <span class="label label-success">
                                {$order_type[$vo['order_type']]}
                            </span>
                            <else/>
                            <span class="label btn-danger">
                                {$order_type[$vo['order_type']]}
                            </span>
                        </if>
                    </td>
                    <td>
                        <if condition="$vo.order_status eq 1">
                            <span class="label label-success">
                                {$status[$vo['order_status']]}
                            </span>
                            <elseif condition="$vo.order_status eq 2"/>
                            <span class="label btn-danger">
                                {$status[$vo['order_status']]}
                            </span>
                            <else/>
                            <span class="label btn-danger">
                                {$status[$vo['order_status']][$vo['order_type']]}
                            </span>
                        </if>
                    </td>
                    <td>
                        <a class="btn btn-xs btn-success"  href="{:url('AuditionOrder/detail',array('order_id'=>$vo['order_id']))}">查看订单详情</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
    function search() {
        $("#formurl").attr('action', "{:url('AuditionOrder/index')}");
        return true;
    }
    function excel() {
        $("#formurl").attr('action', "{:url('AuditionOrder/excel')}");
        return true;
    }
</script>
</body>
</html>